Skip to content

feat: rebuild cli functionality#318

Closed
sroussey wants to merge 17 commits intomainfrom
claude/rebuild-cli-functionality-2uYbC
Closed

feat: rebuild cli functionality#318
sroussey wants to merge 17 commits intomainfrom
claude/rebuild-cli-functionality-2uYbC

Conversation

@sroussey
Copy link
Copy Markdown
Collaborator

No description provided.

claude and others added 3 commits March 14, 2026 19:42
Replace the old task-specific CLI commands (embedding, summarize, etc.)
with a resource-oriented architecture: model, workflow, agent, and task
subcommands with CRUD operations. Storage is backed by FsFolderTabularStorage
with config via ~/.workglow.toml.

New commands:
- workglow init — initialize config and directories
- workglow model [list|add|remove] — manage model definitions
- workglow workflow [list|add|remove|run] — manage and run workflows
- workglow agent [list|add|remove|run] — manage and run agents
- workglow task [list|run] — list registered tasks, run ad-hoc tasks

https://claude.ai/code/session_01RUjsHV3Y7DvGvBnhSi3XLr
- Added MCP configuration management to the CLI, including commands for adding and removing MCPs.
- Updated existing commands to support JSON input from files and strings, with validation and dry-run options.
- Introduced new utility functions for outputting results and formatting errors.
- Enhanced task and workflow commands to include dynamic flag parsing and schema validation.
- Updated package dependencies and configurations for improved compatibility and functionality.
@sroussey sroussey self-assigned this Mar 18, 2026
Comment thread examples/cli/src/input/schema-flags.ts Fixed
Comment thread examples/cli/src/ui/SchemaPromptApp.tsx Fixed
sroussey and others added 12 commits March 18, 2026 17:03
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…pageSize prop

- Add isLoadingMore state alongside ref so spinner triggers re-render
- Remove unused pageSize from SearchSelectAppProps

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All remove commands (model, mcp, workflow, agent) now accept an
optional id. When omitted on a TTY, a Select list is presented
so the user can pick which item to remove. Esc cancels.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…earch

- HF_INFERENCE: live search HuggingFace API
- HF_TRANSFORMERS_ONNX: live search with library=onnx filter
- LOCAL_LLAMACPP: live search with tags=gguf filter
- ANTHROPIC: SDK client.beta.models.list(), falls back to static list
- OPENAI: SDK client.models.list(), falls back to static list
- OLLAMA: SDK client.list() for locally installed models
- GOOGLE_GEMINI: static list of known models
- TENSORFLOW_MEDIAPIPE / WEB_BROWSER: static lists

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SchemaPromptApp now has onCancel prop. Escape exits the form cleanly
instead of navigating back (use Shift+Tab/arrows for that).
renderSchemaPrompt returns undefined on cancel, promptMissingInput
exits the process. SelectPromptApp and SearchSelectApp already
handled Escape.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SelectPromptApp: visibleOptionCount adapts to terminal height, shows
all items when they fit, adds "(N items, scroll with ↑↓)" when
truncated.

SearchSelectApp: visible window adapts to terminal height instead of
hardcoded 10. Already had "N more above/below" indicators.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
After the TUI unmounts, prints "✓ <context>: <choice>" so the user
sees what was selected. Applies to both renderSelectPrompt and
renderSearchSelect.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All three render helpers (renderSchemaPrompt, renderSearchSelect,
renderSelectPrompt) now print "Cancelled." after unmounting when
the user presses Escape.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Call instance.clear() before instance.unmount() so the rendered form
is removed from the terminal. Previously the form content stayed
on screen after selection or cancel.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Added `setNestedValue` and `getNestedValue` functions to safely set and retrieve values in nested objects using dot notation, while preventing prototype pollution. Updated imports in relevant files to utilize these new utility functions, removing redundant implementations.
Comment thread examples/cli/src/util.ts Dismissed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR rebuilds the examples/cli into a structured, Commander-based CLI with filesystem-backed repositories and Ink-based interactive UIs, and updates MCP server JSON schemas to express transport-specific required fields.

Changes:

  • Add new CLI command groups (init, model, mcp, workflow, agent, task) with interactive add/find/run flows and schema-driven flags/prompts.
  • Introduce Ink/@inkjs/ui-based TUI components for running tasks/workflows, interactive selection, and schema prompting.
  • Update MCP server config schemas to include transport-conditional required fields via allOf.

Reviewed changes

Copilot reviewed 40 out of 41 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/util/src/mcp/McpClientUtil.node.ts Adds allOf transport conditionals so command/server_url become conditionally required.
packages/util/src/mcp/McpClientUtil.browser.ts Adds allOf transport conditionals so server_url is conditionally required.
examples/cli/tsconfig.json Simplifies TS inputs to rely on include instead of explicit files.
examples/cli/src/workglow.ts New CLI entrypoint wiring task registration, config loading, and command registration.
examples/cli/src/worker_hft.ts Removed HFT worker entrypoint.
examples/cli/src/worker_error.ts Removed worker error helper.
examples/cli/src/util.ts Adds shared stdin/output/error/table utilities for the CLI.
examples/cli/src/ui/render.ts Adds Ink render helpers for task/workflow runs and interactive prompts/selectors.
examples/cli/src/ui/components/TaskStatusLine.tsx Status line component for task display in the TUI.
examples/cli/src/ui/components/StreamOutput.tsx Streaming text output component for task TUI.
examples/cli/src/ui/components/ProgressBar.tsx Simple progress bar component for Ink UI.
examples/cli/src/ui/WorkflowRunApp.tsx Ink app for running a workflow graph with progress/status display.
examples/cli/src/ui/TaskRunApp.tsx Ink app for running a single task with progress + streaming output.
examples/cli/src/ui/SelectPromptApp.tsx Interactive select prompt (non-search) using @inkjs/ui Select.
examples/cli/src/ui/SearchSelectApp.tsx Live-search + infinite-scroll selector UI for “find” commands.
examples/cli/src/ui/SchemaPromptApp.tsx Interactive schema-driven form for missing required fields.
examples/cli/src/storage.ts Adds filesystem-backed repositories for models/workflows/agents and MCP storage.
examples/cli/src/lib.ts Re-exports config and storage helpers (replacing old TaskGraph UI exports).
examples/cli/src/input/schema-flags.ts Implements schema-driven single-dash flag parsing + help text generation.
examples/cli/src/input/resolve-input.ts Implements JSON/stdin/flag input merging, defaults, and validation helpers.
examples/cli/src/input/prompt.ts Detects missing required fields (including conditional allOf) and prompts via Ink.
examples/cli/src/input/index.ts Barrel exports for input helpers.
examples/cli/src/config.ts Adds TOML-backed CLI configuration with default paths.
examples/cli/src/commands/workflow.ts Adds workflow list/add/remove/run commands with schema-driven input flags + TUI run.
examples/cli/src/commands/task.ts Adds task list/run with schema/config flag parsing and optional TUI run.
examples/cli/src/commands/model.ts Adds model list/add/remove/find with provider-aware schemas and registry/SDK discovery.
examples/cli/src/commands/mcp.ts Adds MCP list/add/remove/find with registry discovery and transport-specific validation.
examples/cli/src/commands/init.ts Adds init command to write config and create directories.
examples/cli/src/commands/agent.ts Adds agent list/add/remove/run commands mirroring workflow behavior.
examples/cli/src/components/TaskUI.tsx Removed legacy Ink task UI implementation.
examples/cli/src/components/TaskGraphUI.tsx Removed legacy graph UI wrapper.
examples/cli/src/components/Elements.tsx Removed legacy UI helpers (spinner/progress bar/etc.).
examples/cli/src/components/App.tsx Removed legacy Ink app wrapper.
examples/cli/src/TaskGraphToUI.ts Removed legacy graph-to-Ink runner.
examples/cli/src/TaskCLI.ts Removed large legacy CLI implementation in favor of new command structure.
examples/cli/src/ONNXModelSamples.ts Removed local ONNX sample model registration.
examples/cli/package.json Updates dependencies for Ink v5 + React 18 and adds @inkjs/ui; adjusts build scripts accordingly.
docs/superpowers/specs/2026-03-18-cli-find-command-design.md Adds design spec documenting the new find command UX and architecture.
docs/superpowers/plans/2026-03-18-cli-find-command.md Adds implementation plan for the find commands and SearchSelectApp.
bun.lock Lockfile updates reflecting CLI dependency changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +39 to +45
return new Promise<void>((resolve, reject) => {
const onComplete = async (result: unknown) => {
await outputResult(result, opts.outputJsonFile);
instance.clear();
instance.unmount();
resolve();
};
Comment on lines +74 to +80
return new Promise<void>((resolve, reject) => {
const onComplete = async (result: unknown) => {
await outputResult(result, opts.outputJsonFile);
instance.clear();
instance.unmount();
resolve();
};
Comment on lines +48 to +50
task.events.on("stream_chunk", (event: { type: string; text?: string }) => {
if (event.type === "text-delta" && event.text) {
setStreamText((prev) => prev + event.text);
@sroussey sroussey closed this Mar 18, 2026
@sroussey sroussey deleted the claude/rebuild-cli-functionality-2uYbC branch April 9, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants